home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / quicktime / quicktimeintro / play movie w.controller / start code / edit.c next >
Encoding:
Text File  |  2000-10-06  |  2.0 KB  |  98 lines

  1. // Play Movie with Controller Sample
  2. // Based on QTShell
  3. // WWDC 2000
  4.  
  5. #include "ComApplication.h"
  6. #include "ComFramework.h"
  7. #include "MacFramework.h"
  8.  
  9. //////////
  10. //
  11. // HandleEditMenuItem
  12. // Perform the specified edit operation on the specified window.
  13. //
  14. //////////
  15.  
  16. void HandleEditMenuItem (WindowReference theWindow, UInt16 theMenuItem)
  17. {
  18.     WindowObject        myWindowObject = NULL;
  19.     MovieController     myMC = NULL;
  20.     Movie                 myEditMovie = NULL;                // the movie created by some editing operations
  21.     
  22.     // give the application-specific code a chance to intercept the menu item selection
  23.     if (QTApp_HandleMenu(theMenuItem))
  24.         return;
  25.     
  26.     myWindowObject = QTFrame_GetWindowObjectFromWindow(theWindow);
  27.     myMC = QTFrame_GetMCFromWindow(theWindow);
  28.     
  29.     // make sure we have a valid movie controller and a valid window object
  30.     if ((myMC == NULL) || (myWindowObject == NULL))
  31.         return;
  32.  
  33.     switch (theMenuItem) {
  34.     
  35. // Step 1. Insert SwitchEdit.clp here...
  36.  
  37.         default:
  38.             break;
  39.     } // switch (theMenuItem)
  40.     
  41.     // place any cut or copied movie segment onto the scrap
  42.     if (myEditMovie != NULL) {
  43.         PutMovieOnScrap(myEditMovie, 0L);
  44.         DisposeMovie(myEditMovie);
  45.     }
  46. }
  47.  
  48. //////////
  49. //
  50. // SelectAllMovie
  51. // Select the entire movie associated with the specified movie controller.
  52. // 
  53. //////////
  54.  
  55. OSErr SelectAllMovie (MovieController theMC)
  56. {
  57.     TimeRecord            myTimeRecord;
  58.     Movie                 myMovie = NULL;
  59.     ComponentResult        myErr = noErr;
  60.     
  61.     if (theMC == NULL)
  62.         return(paramErr);
  63.     
  64.     myMovie = MCGetMovie(theMC);
  65.     if (myMovie == NULL)
  66.         return(paramErr);
  67.     
  68. // Step 2. Insert SelectAll.clp here...
  69.     
  70.     return((OSErr)myErr);
  71. }
  72.  
  73.  
  74. //////////
  75. //
  76. // SelectNoneMovie
  77. // Select none of the movie associated with the specified movie controller.
  78. // 
  79. //////////
  80.  
  81. OSErr SelectNoneMovie (MovieController theMC)
  82. {
  83.     TimeRecord            myTimeRecord;
  84.     Movie                 myMovie = NULL;
  85.     ComponentResult        myErr = noErr;
  86.     
  87.     if (theMC == NULL)
  88.         return(paramErr);
  89.     
  90.     myMovie = MCGetMovie(theMC);
  91.     if (myMovie == NULL)
  92.         return(paramErr);
  93.     
  94. // Step 3. Insert SelectNone.clp here...
  95.     
  96.     return((OSErr)myErr);
  97. }
  98.